home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / WD_SRC.ZIP / SYSTEM / DYNARRAY.HPP < prev    next >
C/C++ Source or Header  |  1994-12-29  |  2KB  |  120 lines

  1. //  dynarray.hpp  Header file for Mike's dynamic array classes.  These are only created to ease portability to the Mac.
  2. //                  Normally I would use Microsoft's classes.
  3.  
  4. #ifndef DYNARRAY_HEADER
  5. #define DYNARRAY_HEADER
  6.  
  7.  
  8. class MDWordArray
  9. {
  10. public:
  11.     MDWordArray();
  12.     ~MDWordArray();
  13.  
  14.     MDWordArray &operator=( MDWordArray ©From );
  15.     
  16.     DWORD Get( UWORD index );
  17.     BOOL   Set( UWORD index, DWORD newVal );
  18.     UWORD NumElements();
  19.  
  20.     BOOL   Insert( UWORD index, DWORD toInsert );
  21.     BOOL   Delete( UWORD index );
  22.     BOOL   Append( DWORD toAdd );
  23.     BOOL   SetSize( UWORD newSize );
  24.  
  25.     DWORD    *GetBuffer()    {return pDWordArray;}
  26.  
  27.     DWORD *pDWordArray;
  28.     UWORD nElements;
  29.  
  30.     BOOL   CheckIndex( UWORD index );
  31. };
  32.  
  33.  
  34. class MWordArray
  35. {
  36. public:
  37.     MWordArray();
  38.     ~MWordArray();
  39.     
  40.     MWordArray &operator=( MWordArray ©From );
  41.     
  42.     WORD  Get( UWORD index );
  43.     BOOL   Set( UWORD index, WORD newVal );
  44.     UWORD NumElements();
  45.  
  46.     BOOL   Insert( UWORD index, WORD toInsert );
  47.     BOOL   Delete( UWORD index );
  48.     BOOL   Append( WORD toAdd );
  49.     BOOL   SetSize( UWORD newSize );
  50.  
  51.  
  52.  
  53.     WORD  *pWordArray;
  54.     UWORD nElements;
  55.  
  56.     BOOL   CheckIndex( UWORD index );
  57. };
  58.  
  59.  
  60. class MByteArray
  61. {
  62. public:
  63.     MByteArray();
  64.     ~MByteArray();
  65.     
  66.     MByteArray &operator=( MByteArray ©From );
  67.  
  68.     BYTE  Get( UWORD index );
  69.     BOOL   Set( UWORD index, BYTE newVal );
  70.     UWORD NumElements();
  71.  
  72.     BOOL   Insert( UWORD index, BYTE toInsert );
  73.     BOOL   Delete( UWORD index );
  74.     BOOL   Append( BYTE toAdd );
  75.     BOOL   SetSize( UWORD newSize );
  76.  
  77.  
  78.  
  79.     BYTE  *pByteArray;
  80.     UWORD nElements;
  81.  
  82.     BOOL   CheckIndex( UWORD index );
  83. };
  84.  
  85.  
  86. class MPointerArray
  87. {
  88. public:
  89.     MPointerArray();
  90.     ~MPointerArray();
  91.     
  92.     MPointerArray &operator=( MPointerArray ©From );
  93.     
  94.     void    *Get( UWORD index );
  95.     BOOL    Set( UWORD index, void *newVal );
  96.     UWORD    NumElements();
  97.  
  98.     BOOL   Insert( UWORD index, void *toInsert );
  99.     BOOL   Delete( UWORD index );
  100.     BOOL   Append( void *toAdd );
  101.     BOOL   SetSize( UWORD newSize );
  102.  
  103.     Index    GetIndexFromPointer( void *pMatch );
  104.  
  105.     void    **pPointerArray;
  106.     UWORD nElements;
  107.  
  108.     BOOL   CheckIndex( UWORD index );
  109. };
  110.  
  111.  
  112. Index ScanForPointer( void *scanFor, void *scanIn, DWORD nPointers );
  113.  
  114.  
  115. #endif
  116.  
  117.  
  118.  
  119.  
  120.